package com.auto.autoapp.adapter

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.auto.autoapp.R
import com.auto.autoapp.model.TaskInfo
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class TaskAdapter : BaseQuickAdapter<TaskInfo, BaseViewHolder>(R.layout.item_task) {

    override fun convert(
        holder: BaseViewHolder,
        item: TaskInfo
    ) {
        val icon: ImageView = holder.getView(R.id.iv_icon)
        val name: TextView = holder.getView(R.id.tv_name)
        val subTitle: TextView = holder.getView(R.id.tv_sub_title)
        val arrow: ImageView = holder.getView(R.id.iv_arrow)

        icon.setImageResource(item.iconRes)
        subTitle.text = item.subTitle
        name.text = item.name
    }

}